import {FormProps, FormSchema} from '/@/components/Table';
import {BasicColumn} from '/@/components/Table/src/types/table';
import { dateUtil } from '/@/utils/dateUtil';

//表格显示列
export function getBasicColumns(): BasicColumn[] {
  // @ts-ignore
  return [

    {
      title: '注册人数',
      dataIndex: 'numberOfRegistrants',
      width: 100,

    },{
      title: '合格人数',
      dataIndex: 'numberOfQualified',
      width: 100,

    },
    {
      title: '公需课学习人数',
      dataIndex: 'numberOfPublicCourse',
      width: 100,
    },
    {
      title: '专业课学习人数',
      dataIndex: 'numberOfProfessionalCourse',
      width: 100,
    },
  ];
}

export function getFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 150,
    baseColProps: {lg: 6, md: 24},
    schemas: formParamSchema,
  };
}


const basicOptions: ({ label: string; value: string })[] = [
  {
    label: '2023',
    value: '2023',
  },
  {
    label: '2022',
    value: '2022',
  },
];

//查询条件表单
export const formParamSchema: FormSchema[] = [
  {
    field: 'years',
    component: 'Select',
    // 设置默认值 2023
    defaultValue: '2023',
    label: '专业年度',
    componentProps: {
      options: basicOptions
    },
    required: true,
  },
  {
    field: 'time',
    component: 'RangePicker',
    // 设置默认值 2023-01-01 - 当前日期
    defaultValue: [dateUtil('2023-01-01').format('YYYY-MM-DD'), dateUtil().format('YYYY-MM-DD')],
    label: '学习时间',
    required: true,
    colProps: {
      offset: 2,
    },
  },

];



